<!DOCTYPE html>
<html>
<head>
	<title>{if $title}{$title}{else}{if !empty($_W['account']['name'])}{$_W['account']['name']}{/if}{/if}</title>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
	<!-- Mobile Devices Support @begin -->
	<meta content="application/xhtml+xml;charset=UTF-8" http-equiv="Content-Type">
	<meta content="no-cache,must-revalidate" http-equiv="Cache-Control">
	<meta content="no-cache" http-equiv="pragma">
	<meta content="0" http-equiv="expires">
	<meta content="telephone=no, address=no" name="format-detection">
	<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
	<meta name="apple-mobile-web-app-capable" content="yes" /> <!-- apple devices fullscreen -->
	<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
	<!-- Mobile Devices Support @end -->
	<meta name="keywords" content="{if empty($_W['setting']['copyright']['keywords'])}微赞,微信,微信公众平台{else}{$_W['setting']['copyright']['keywords']}{/if}" />
	<meta name="description" content="{if empty($_W['setting']['copyright']['description'])}微信公众平台自助引擎，简称微赞，微赞是一款免费开源的微信公众平台管理系统。{else}{$_W['setting']['copyright']['description']}{/if}" />
	<script type="text/javascript" src="./resource/script/jquery-1.7.2.min.js"></script>
	{if $bootstrap_type == 3}
	<link type="text/css" rel="stylesheet" href="./themes/default/style/bootstrap.css">
	<script type="text/javascript" src="./themes/default/script/bootstrap.min.js"></script>
	{else}
	<link type="text/css" rel="stylesheet" href="./resource/style/bootstrap.css">
	<script type="text/javascript" src="./resource/script/bootstrap.js"></script>
	{/if}
	<link type="text/css" rel="stylesheet" href="./resource/style/font-awesome.min.css" />
	<link type="text/css" rel="stylesheet" href="./themes/default/style/common.mobile.css">
	<script type="text/javascript" src="./resource/script/cascade.js"></script>
	<script type="text/javascript" src="./themes/default/script/jquery.touchwipe.js"></script>
	<script type="text/javascript" src="./themes/default/script/swipe.js"></script>
	<!--[if IE 7]>
	<link rel="stylesheet" href="./resource/style/font-awesome-ie7.min.css">
	<![endif]-->
</head>
<body id="cate59">
<style>
html, body {
	color:#222;
	font-family:Microsoft YaHei,Helvitica,Verdana,Tohoma,Arial,san-serif;
	margin:0;
	padding: 0;
	text-decoration: none;
}
body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, legend, input, textarea, p, blockquote, th, td {
	margin:0;
	padding:0;
}
img {
	border:0;
}
ol, ul {
	list-style: none outside none;
	margin:0;
	padding: 0;
}
a {
	color:#000000;
	text-decoration: none;
}
.clr {
	display:block;
	clear:both;
	height:0;
	overflow:hidden;
}
.copyright{padding:8px;text-align:center;font-size:14px;color:#666;}
.copyright a{color:#666;}

#cate59 { background-color:{$_W['styles']['indexbgcolor']}; font-size:14px; }


#cate59  .mainmenu {  overflow:hidden; margin:8px 8px 0px 0px; display: block;}
#cate59  .mainmenu li { float:left;  width:33.3%;      }

#cate59  .mainmenu li a { display:block; background-color:#00ccff;height:90px;  color:#FFF; margin:0px 0px 8px 8px;  text-align:center;  border-radius:5px ;overflow:hidden; position:relative;}
#cate59  .mainmenu li a:active{opacity:0.5}
#cate59  .mainmenu li a img {  width:35px; height:35px; margin-top:15px;   }
#cate59  .mainmenu li a p:first-of-type { display:block;  margin:auto; text-align:center;  line-height:25px; font-size:14px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
#cate59  .mainmenu li a p:last-child { display: none;  margin:auto; text-align:center; height:32px; line-height:14px; font-size:12px; overflow:hidden;overflow:hidden; text-overflow:ellipsis; white-space:nowrap }


#cate59  .mainmenu li:nth-child(10n+1){ width:50%; }
#cate59  .mainmenu li:nth-child(10n+1) a{ background:-webkit-gradient(linear, 80% 20%, 10% 21%, from(#13a9b7), to(#01889e)); height:146px; padding:0px;}
#cate59  .mainmenu li:nth-child(10n+1) a p:first-of-type{ text-align:center; font-size:18px; margin-top:10px; }
#cate59  .mainmenu li:nth-child(10n+1) a  p:last-child{ display:none;  }
#cate59  .mainmenu li:nth-child(10n+1) a img{ width:75px; height:75px; margin-top:25px;}
#cate59  .mainmenu li:nth-child(10n+2),#cate59  .mainmenu li:nth-child(10n+3){ width:50%;  }
#cate59  .mainmenu li:nth-child(10n+2) a{height:64px; padding-top:5px; background-color:#2b87ee }
#cate59  .mainmenu li:nth-child(10n+3) a{height:64px;padding-top:5px; background-color:#ab09b4 }
#cate59  .mainmenu li:nth-child(10n+4),#cate59  .mainmenu li:nth-child(10n+10){ width:66.7%; }

#cate59  .mainmenu li:nth-child(10n+2) img,#cate59  .mainmenu li:nth-child(10n+3) img,#cate59  .mainmenu li:nth-child(10n+4) img{ margin-top:0px;}
#cate59  .mainmenu li:nth-child(10n+4) p:first-of-type{ display:none;}
#cate59  .mainmenu li:nth-child(10n+4) p:last-child{ display:none;}
#cate59  .mainmenu li:nth-child(10n+4) img{ position:absolute; left:0px; top:0px;  width:auto; height:90px; z-index:1}
#cate59  .mainmenu li:nth-child(10n+5) a{ background:-webkit-gradient(linear, 80% 20%, 10% 21%, from(#246ac9), to(#0a51b9));}
#cate59  .mainmenu li:nth-child(10n+6) a{ background:-webkit-gradient(linear, 80% 20%, 10% 21%, from(#bf44c1), to(#a903ad));}
#cate59  .mainmenu li:nth-child(10n+8) a{ background-color:#11ac13}
#cate59  .mainmenu li:nth-child(10n+9) a{ background:-webkit-gradient(linear, 80% 20%, 10% 21%, from(#e26743), to(#dc572e));}
#cate59  .mainmenu li:nth-child(10n+10) a{ background:-webkit-gradient(linear, 80% 20%, 10% 21%, from(#c02851), to(#b41a41));}
#cate59  .mainmenu li:nth-child(10n+7) a p:first-of-type{ display:none}
#cate59  .mainmenu li:nth-child(10n+7) img{ margin-top:0px; width: auto;height: 90px;}

</style>

{template 'slide'}
<div id="insert1"></div>
<ul class="mainmenu">
{loop $navs $nav}
<li><a href="{$nav['url']}"><img src="{$_W['attachurl']}{$nav['icon']}"><p>{$nav['name']}</p><p></p></a></li>
{/loop}
</ul>
<div id="insert2"></div>

<div class="copyright">{if empty($footer_off)}&copy;{if empty($_W['account']['name'])}微赞团队{else}{$_W['account']['name']}{/if}&nbsp;&nbsp;{$_W['setting']['copyright']['statcode']}{/if}</div>


{if $_W['quickmenu']['menus']}
	{template $_W['quickmenu']['template']}
{/if}
<script type="text/javascript">
$(function() {
	$(".user-box .box-item").each(function(i) {
		i = i +1;
		if(i%3 == 0) $(this).css("border-right", "0");
	});
	$(window).scroll(function(){
		$(".menu-button").find("i").removeClass("icon-minus-sign").addClass("icon-plus-sign");
		$(".menu-main").hide();
	});
	$(".menu-main a").click(function(){ $(".menu-main").hide(); });

	//控制tab宽度
	var profile_tab = $(".nav-tabs li");
	profile_tab.css({"width": 100/profile_tab.length+"%", "text-align": "center"});

	//手机表单处理
	$(".form-table").delegate(".checkbox input[type='checkbox']", "click", function(){
		$(this).parent().toggleClass("btn-inverse");
	});
	$(".form-table").delegate(".file input[type='file']", "change", function(){
		var a = $(this).next("button");
		a.html(a.html() +' '+  $(this).val());
	});

	//处理固定横向导航条
	var navbarFixedTop = false, navbarFixedBottom = false;
	navbarFixedTop = $(".navbar").hasClass("navbar-fixed-top");
	navbarFixedBottom = $(".navbar").hasClass("navbar-fixed-bottom");
	if(navbarFixedTop) $("body").css("padding-top", "41px");
	if(navbarFixedBottom) $("body").css("padding-bottom", "41px");
});

//对分享时的数据处理
function _removeHTMLTag(str) {
	str = str.replace(/<script[^>]*?>[\s\S]*?<\/script>/g,'');
	str = str.replace(/<style[^>]*?>[\s\S]*?<\/style>/g,'');
    str = str.replace(/<\/?[^>]*>/g,'');
    str = str.replace(/\s+/g,'');
    str = str.replace(/&nbsp;/ig,'');
    return str;
}
document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
	<?php
		$_share = array();
		$_share['title'] = (empty($title)) ? $_W['account']['name'] : $title;
		$_share['link'] = 'http://'.$_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . '&wxref=mp.weixin.qq.com';
		$_share['img'] = $_W['siteroot'] . 'source/modules/' . $_GPC['name'] . '/icon.jpg';
	?>
	var _share_img = $('body img:eq(0)').attr("src");
	if(typeof(_share_img) == "undefined") _share_img = "{$_share['img']}";
	var _share_content = _removeHTMLTag($('body').html()).replace("{$_share['title']}",'');

	window.shareData = {
		"imgUrl": _share_img,
		"timeLineLink": "{$_share['link']}",
		"sendFriendLink": "{$_share['link']}",
		"weiboLink": "{$_share['link']}",
		"tTitle": "{$_share['title']}",
		"tContent":  _share_content,
		"fTitle": "{$_share['title']}",
		"fContent":  _share_content,
		"wContent":  "{$_share['title']}"
	};

	// 发送给好友
	WeixinJSBridge.on('menu:share:appmessage', function (argv) {
		WeixinJSBridge.invoke('sendAppMessage', {
			"img_url": window.shareData.imgUrl,
			"img_width": "640",
			"img_height": "640",
			"link": window.shareData.sendFriendLink,
			"desc": window.shareData.fContent,
			"title": window.shareData.fTitle
		}, function (res) {
			_report('send_msg', res.err_msg);
		})
	});

	// 分享到朋友圈
	WeixinJSBridge.on('menu:share:timeline', function (argv) {
		WeixinJSBridge.invoke('shareTimeline', {
			"img_url": window.shareData.imgUrl,
			"img_width": "640",
			"img_height": "640",
			"link": window.shareData.timeLineLink,
			"desc": window.shareData.tContent,
			"title": window.shareData.tTitle
		}, function (res) {
			_report('timeline', res.err_msg);
		});
	});

	// 分享到微博
	WeixinJSBridge.on('menu:share:weibo', function (argv) {
		WeixinJSBridge.invoke('shareWeibo', {
			"content": window.shareData.wContent,
			"url": window.shareData.weiboLink
		}, function (res) {
			_report('weibo', res.err_msg);
		});
	});
}, false);
</script>
</body>
</html>
